Support key ranges below top level
authorjustbur <justin@burkett.cc>
Sun, 10 Apr 2016 19:05:02 +0000 (15:05 -0400)
committerjustbur <justin@burkett.cc>
Sun, 10 Apr 2016 19:05:02 +0000 (15:05 -0400)
which-key.el

index d0052e38c850fbe9bc95434a830fc72f2317ec6a..ce4dd749dc7e8e77f79221e058fb15dd858f36bd 100644 (file)
@@ -1420,6 +1420,15 @@ alists. Returns a list (key separator description)."
                          (string-match (format "^%s[ \t]\\([^ \t]+\\)[ \t]+$" key-str-qt) key))
                     (unless (assoc-string (match-string 1 key) bindings)
                       (push (cons (match-string 1 key) binding) bindings)))
+                   ((and which-key--current-prefix
+                         (string-match
+                          (format
+                           "^%s[ \t]\\([^ \t]+\\) \\.\\. %s[ \t]\\([^ \t]+\\)[ \t]+$"
+                           key-str-qt key-str-qt) key))
+                    (let ((stripped-key
+                           (concat (match-string 1 key) " \.\. " (match-string 2 key))))
+                      (unless (assoc-string stripped-key bindings)
+                        (push (cons stripped-key binding) bindings))))
                    ((string-match "^\\([^ \t]+\\|[^ \t]+ \\.\\. [^ \t]+\\)[ \t]+$" key)
                     (unless (assoc-string (match-string 1 key) bindings)
                       (push (cons (match-string 1 key) binding) bindings)))))))))